Skip to content

Fix compilation without libnl3#183

Closed
vincele wants to merge 1 commit intoNetworkBlockDevice:masterfrom
vincele:fix_compil_libnl3
Closed

Fix compilation without libnl3#183
vincele wants to merge 1 commit intoNetworkBlockDevice:masterfrom
vincele:fix_compil_libnl3

Conversation

@vincele
Copy link
Copy Markdown

@vincele vincele commented Mar 22, 2026

Error is in the commit message. I'm not completely sure this is the "right" way to fix it.

Seen on void linux (musl lilbc) compilation. Just adding libnl3-devel to the dependencies also fixed the compilation failure (configure script then found it), thus avoiding the need for this patch. But that looks like working around the problem.

I still think this should be fixed at the code level, so here is an attempt.

WDYT ?

Error was:
```
    nbd-client.c: In function 'main':
    nbd-client.c:1723:32: error: implicit declaration of function 'persist_mode_main' [-Wimplicit-function-declaration]
     1723 |                         return persist_mode_main(index, sockfds, flags);
          |                                ^~~~~~~~~~~~~~~~~
```

Signed-off-by: Vincent Legoll <[email protected]>
vincele added a commit to vincele/void-packages that referenced this pull request Mar 22, 2026
- new version
- move from sourceforge to github
- add gnutls library
- fix compilation by adding libnl3 which is detected by configure script
  and defines macros modifying the code. Error was:
```
    nbd-client.c: In function 'main':
    nbd-client.c:1723:32: error: implicit declaration of function 'persist_mode_main' [-Wimplicit-function-declaration]
     1723 |                         return persist_mode_main(index, sockfds, flags);
          |                                ^~~~~~~~~~~~~~~~~
```

Compilation problem reported upstream, with a proposed fix:
NetworkBlockDevice/nbd#183
vincele added a commit to vincele/void-packages that referenced this pull request Mar 22, 2026
- new version
- move from sourceforge to github
- add gnutls library

-  fix compilation warning, by removing CFLAGS addition:
```
    <command-line>: warning: "PROG_NAME" redefined
    <command-line>: note: this is the location of the previous definition
```

- fix compilation by adding libnl3 which is detected by configure script
  and defines macros modifying the code. Error was:
```
    nbd-client.c: In function 'main':
    nbd-client.c:1723:32: error: implicit declaration of function 'persist_mode_main' [-Wimplicit-function-declaration]
     1723 |                         return persist_mode_main(index, sockfds, flags);
          |                                ^~~~~~~~~~~~~~~~~
```

NETLINK-related compilation problem reported upstream, with a proposed fix:
NetworkBlockDevice/nbd#183
vincele added a commit to vincele/void-packages that referenced this pull request Mar 22, 2026
- new version
- move from sourceforge to github
- add gnutls library

-  fix compilation warning, by removing CFLAGS addition:
```
    <command-line>: warning: "PROG_NAME" redefined
    <command-line>: note: this is the location of the previous definition
```

- fix compilation by adding libnl3 which is detected by configure script
  and defines macros modifying the code. Error was:
```
    nbd-client.c: In function 'main':
    nbd-client.c:1723:32: error: implicit declaration of function
    'persist_mode_main' [-Wimplicit-function-declaration]
     1723 |                         return persist_mode_main(index,
            sockfds, flags);
          |                                ^~~~~~~~~~~~~~~~~
```

NETLINK-related compilation problem reported upstream, with a proposed fix:
NetworkBlockDevice/nbd#183
vincele added a commit to vincele/void-packages that referenced this pull request Mar 25, 2026
- new version
- move from sourceforge to github
- add gnutls library

-  fix compilation warning, by removing CFLAGS addition:
```
    <command-line>: warning: "PROG_NAME" redefined
    <command-line>: note: this is the location of the previous definition
```

- fix compilation by adding libnl3 which is detected by configure script
  and defines macros modifying the code. Error was:
```
    nbd-client.c: In function 'main':
    nbd-client.c:1723:32: error: implicit declaration of function
    'persist_mode_main' [-Wimplicit-function-declaration]
     1723 |                         return persist_mode_main(index,
            sockfds, flags);
          |                                ^~~~~~~~~~~~~~~~~
```

NETLINK-related compilation problem reported upstream, with a proposed fix:
NetworkBlockDevice/nbd#183
vincele added a commit to vincele/void-packages that referenced this pull request Mar 25, 2026
- new version
- move from sourceforge to github
- add gnutls library

-  fix compilation warning, by removing CFLAGS addition:
```
    <command-line>: warning: "PROG_NAME" redefined
    <command-line>: note: this is the location of the previous definition
```

- fix compilation by adding libnl3 which is detected by configure script
  and defines macros modifying the code. Error was:
```
    nbd-client.c: In function 'main':
    nbd-client.c:1723:32: error: implicit declaration of function
    'persist_mode_main' [-Wimplicit-function-declaration]
     1723 |                         return persist_mode_main(index,
            sockfds, flags);
          |                                ^~~~~~~~~~~~~~~~~
```

NETLINK-related compilation problem reported upstream, with a proposed fix:
NetworkBlockDevice/nbd#183
vincele added a commit to vincele/void-packages that referenced this pull request Apr 1, 2026
- new version
- move from sourceforge to github
- add gnutls library

-  fix compilation warning, by removing CFLAGS addition:
```
    <command-line>: warning: "PROG_NAME" redefined
    <command-line>: note: this is the location of the previous definition
```

- fix compilation by adding libnl3 which is detected by configure script
  and defines macros modifying the code. Error was:
```
    nbd-client.c: In function 'main':
    nbd-client.c:1723:32: error: implicit declaration of function
    'persist_mode_main' [-Wimplicit-function-declaration]
     1723 |                         return persist_mode_main(index,
            sockfds, flags);
          |                                ^~~~~~~~~~~~~~~~~
```

NETLINK-related compilation problem reported upstream, with a proposed fix:
NetworkBlockDevice/nbd#183
@yoe
Copy link
Copy Markdown
Member

yoe commented Apr 9, 2026

In the long run, the ioctl support is going to go away. It's there still in case you need to configure a (very) old kernel, but in general you should be using the netlink codepath these days rather than the ioctl one.

As such, not going to merge this one.

@yoe yoe closed this Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants